#ifndef EXPLORE_H
#define EXPLORE_H

#include <QWebEngineProfile>
#include <QVector>
#include <QUrl>
#include "mainwindow.h"
#include "downloadmanagerwidget.h"
#include "secondmenu.h"
#include "historywidget.h"


class MainWindow;

/**
 * @brief The Explore 浏览器主进程
 */

class Explore
{
public:
    Explore();

    QVector<MainWindow*> windows();

    MainWindow *createWindow(bool offTheRecord = false);


    static QUrl defaultUrl;

    DownloadManagerWidget& downloadManagerWidget();
    SecondMenu & secondMenu(){return m_secondMenu;};
    HistoryWidget &historyWidget(){return m_historyWidget;}

    // 通用参数设置
    // 是否开启性能优化
    static bool enableOptimize;
    static QString defaultLoadUrl;

private:
    // 浏览器配置，用于安全配置或者无痕浏览这些
    QWebEngineProfile m_customProfile;

    // 开启的浏览器窗口列表
    QVector<MainWindow *> m_windows;

    // 下载窗口
    DownloadManagerWidget m_downloadManagerWidget;

    // 二级菜单
    SecondMenu m_secondMenu;

    // 历史记录
    HistoryWidget m_historyWidget;

public slots:
    void handleShowHistoryWidget();

};

#endif // EXPLORE_H
